package com.nd.test.controller;

import java.util.List;
import java.util.Date;

import model.po.CouponsSendingCondition;
import com.nd.test.vo.CouponsSendingConditionVo;
import com.nd.test.repository.CouponsSendingConditionRepository;
import com.nd.test.service.CouponsSendingConditionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**   
 * Create by apisdk 
 */
@RestController
@RequestMapping(value="/couponsSendingCondition")
public class CouponsSendingConditionController {
	@Autowired
	private CouponsSendingConditionRepository couponsSendingConditionRepository;

	@Autowired
	private CouponsSendingConditionService couponsSendingConditionService;

	/**
	* @description create model
	* @return
	*/
	@RequestMapping(value= "", method = RequestMethod.POST)
	public CouponsSendingConditionVo createCouponsSendingCondition(@RequestBody CouponsSendingConditionVo couponsSendingConditionVo) throws Exception {
		return couponsSendingConditionService.createCouponsSendingCondition(couponsSendingConditionVo);
	}

	/**
	* @description get model through id
	* @return
	*/
	@RequestMapping(value= "/{id}", method = RequestMethod.GET)
	public CouponsSendingConditionVo getCouponsSendingConditionById(@PathVariable String id){
		return couponsSendingConditionService.getCouponsSendingConditionById(id);
	}

	/**
	* @description update model through id
	* @return
	*/
	@RequestMapping(value= "/{id}", method = RequestMethod.PUT)
	public CouponsSendingConditionVo updateCouponsSendingConditionById(@PathVariable String id,@RequestBody CouponsSendingConditionVo couponsSendingConditionVo){
		return couponsSendingConditionService.updateCouponsSendingConditionById(id,couponsSendingConditionVo);
	}

	/**
	* @description delete model through id
	* @return
	*/
	@RequestMapping(value= "/{id}", method = RequestMethod.DELETE)
	public void deleteCouponsSendingConditionById(@PathVariable String id){
		couponsSendingConditionService.deleteCouponsSendingConditionById(id);
		return;
	}

}
